package cn.com.cetccst.network.log;

import android.util.Log;

import org.slf4j.Logger;

public class RetrofitLogger {

    private static final String TAG = "MQTTLog";

    private static Logger logger;

    public static void info(String fmt, Object... objs) {
        if (objs != null && objs.length > 0) {
            fmt = String.format(fmt, objs);
        }
        if (logger != null)
            logger.info(fmt);
        else
            Log.e(TAG, fmt);
    }

    public static void error(String message, Throwable e) {
        if (logger != null)
            logger.error(message, e);
        else
            Log.e(TAG, message, e);
    }

    public static void setLogger(Logger logger) {
        RetrofitLogger.logger = logger;
    }
}
